/*
 * Created on Mar 14, 2005
 */
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
 * @author Jesse Phillips
 */
public class KeyTracker implements KeyListener {
	private Objects myObj;
	private int travel = 5;
	
	public KeyTracker(Objects myObj) {
		this.myObj = myObj;
	}
	
	public void keyTyped(KeyEvent e) {
		
	}

	public void keyPressed(KeyEvent e) {
		if (e.getKeyCode() == KeyEvent.VK_LEFT)
		  {
		    myObj.move(-travel);
		  }
		  else if (e.getKeyCode() == KeyEvent.VK_RIGHT)
		  {
		  	myObj.move(travel);
		  }
	}

	public void keyReleased(KeyEvent e) {
		
	}

}
